/**
 * @name user.js
 * @description 用户模块接口
 * @author 'fwq'
 * @time 2021/10/17
 */
import request from "../utils/request";

/***
 * @name getCaptchaAPI
 * @description 用户登录
 * @param data
 * @method post
 * @returns {AxiosPromise}
 */
export function loginByUsername(data) {
  return request({
    url: "/users/login",
    method: "POST",
    data
  });
}

/***
 * @name getCaptchaAPI
 * @description 获取验证码
 * @method get
 * @returns {AxiosPromise}
 */
export function getCaptchaAPI() {
  return request({
    url: "/users/getCode",
    method: "get",
  });
}

/***
 * @name logoutAPI
 * @description 退出登录
 * @method post
 * @returns {AxiosPromise}
 */
export function logoutAPI() {
  return request({
    url: "/users/logout",
    method: "post"
  });
}